﻿<Window x:Class="SLS.Presentation.TABLELISTEN101"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:exc="clr-namespace:SLS.Controls;assembly=CLSControls"
             xmlns:bc="clr-namespace:SLS.Base;assembly=CLSBase"
           xmlns:converters="clr-namespace:SLS.ExClassLib.Converters;assembly=Converters"
             xmlns:ldb="clr-namespace:SLS.Presentation.Data;assembly=TABLELISTTB"
        xmlns:sdb="clr-namespace:SLS.Presentation.Data;assembly=SystemManagementTB"
           xmlns:local="SLS.Presentation"
             x:Name="Container" 
             ToolTip="{Binding DisplayName}"
             xmlns:meffed="http:\\www.codeplex.com\MEFedMVVM"            
            mc:Ignorable="d"             
           d:DesignHeight="300"
           d:DesignWidth="600"         
        >
    <Window.Resources>
        <ldb:TABLELISTDataSet  x:Key="SETUI" />
        <CollectionViewSource x:Key="vwBaseTable" Source="{Binding Path=TABLELIST,Source={StaticResource SETUI}}" />
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="28" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <DockPanel>
            <DockPanel>
                <exc:DropDownButton Content="Connect..." Name="DropDownMenu" ToolTip="Connect to a registered data source in the workspace">
                    <ButtonBase.ContextMenu>
                        <ContextMenu ItemsSource="{Binding Workspace.DataSources}">
                            <ContextMenu.ItemTemplate>
                                <DataTemplate>
                                    <MenuItem Header="{Binding Name}" Click="MenuItem_Click"/>
                                </DataTemplate>
                            </ContextMenu.ItemTemplate>
                        </ContextMenu>
                    </ButtonBase.ContextMenu>
                </exc:DropDownButton>
            </DockPanel>

            <StackPanel Orientation="Horizontal">
                <Button Name="btnDataSourceAdd" Content="DataSourceAdd" Click="btnDataSourceAdd_Click">
                </Button>
                <Button Name="btnGetTables" Content="GetTables" Click="btnGetTables_Click"></Button>
            </StackPanel>
            <ComboBox ItemsSource="{Binding Path=Tables}"
                  DisplayMemberPath="Name"
                  SelectedValuePath="Name"
                  SelectedValue="{Binding Path=Tables}" />

        </DockPanel>

        <exc:TreeViewExtended x:Name="treeViewDB" Grid.Row="2" Tag="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Tag}"
                                   SelectedItemChanged="treeViewDB_SelectedItemChanged" PopulateOnDemand="True">
        </exc:TreeViewExtended>
    </Grid>
    </Window> 
  